#include <iostream>
#include <sstream>
#include <string>
using namespace std;
// g++ -o stringstream stringstream.cc
void Test1() {
  istringstream iss;
  iss.str("水之呼吸 七之型 生生流转");
  string tmp;
  while (iss >> tmp) {
    cout << tmp << endl;
  }
  cout << iss.str() << endl;
  cout << "--------------Test1 Finished!-------------" << endl;
}
void Test2() {
  ostringstream oss;
  string name = "leiyx";
  int age = 22;
  int sex = 0;
  oss << name << age << sex;
  cout << oss.str() << endl;
  cout << "--------------Test2 Finished!-------------" << endl;
}
// TODO:流的状态相关api
int main() {
  Test1();
  Test2();
  return 0;
}